import random
import uuid
import time
from datetime import datetime
from typing import List

class FakeDataGenerator:
    @staticmethod
    def generate_phone() -> str:
        """生成111开头的11位手机号"""
        return f"111{''.join([str(random.randint(0, 9)) for _ in range(8)])}"
    
    @staticmethod
    def generate_uuid() -> str:
        """生成UUID"""
        return str(uuid.uuid4())
    
    @staticmethod
    def generate_timestamp() -> dict:
        """生成当前时间戳（秒和毫秒）"""
        current_time = time.time()
        return {
            "timestamp_seconds": int(current_time),
            "timestamp_milliseconds": int(current_time * 1000),
            "formatted_time": datetime.fromtimestamp(current_time).strftime("%Y-%m-%d %H:%M:%S")
        }
    
    @staticmethod
    def generate_multiple_data(count: int = 1) -> List[dict]:
        """生成多条随机数据"""
        generator = FakeDataGenerator()
        data = []
        for _ in range(count):
            data.append({
                "phone": generator.generate_phone(),
                "uuid": generator.generate_uuid(),
                **generator.generate_timestamp()
            })
        return data
